module lang.d.sts.expressions.dunaryexpression;

import lang.d.sts.expressions.dexpression;
import lang.d.tokens.tokentype;
import lang.d.visitors.dvisitor;

class DUnaryExpression: DExpression {
    private TokenType myOperation;
    private DExpression myExpression;

    public this(in TokenType type) {
        myOperation = type;
    }

    public void setExpression(DExpression expr) {
        myExpression = expr;
        expr.setParent(this);
    }

    public DExpression getExpression() {
        return myExpression;
    }

    public TokenType getOperation() const {
        return myOperation;
    }

    override public void accept(DVisitor visitor) {
        visitor.visitUnaryExpression(this);
    }
}
